fid = fopen('data.out','w');
m = 8;n=4;r = 6;k = 2;
step_a = 2^(-m);
step_b = 2^(-n);
lo = 0.0;
hi = 0.999;

ulp = 2^(-r);

for a=lo:step_a:hi
    for b = lo:step_b:hi
        z = a * b;
        z_r = rnd_near(z, r);
        c = ulp;
        [z_est_r, z_est] = trunc_mult(a, b, c, m, n, r, k);
        disp_mult(a, b, c, z_est, z_est_r, z_r, z, m,n,r,k,fid);
    end    
end